package oa.biz.impl;

import java.sql.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import oa.biz.DocumentBiz;
import oa.entity.Document;
import oa.mapper.DocumentMapper;
@Component
public class DocumentBizImpl implements DocumentBiz{
	@Autowired
	private DocumentMapper mapper;
	@Override
	public List<Document> getAll() {
		return mapper.getAll();
	}
	@Override
	public List<Document> getChild(int parentId) {
		return mapper.getChild(parentId);
	}
	@Override
	public Document fetchDocumentById(int id) {
		return mapper.fetchDocumentById(id);
	}
	@Override
	public void addDocument(Document doc) {
		doc.setCreateTime(new Date(System.currentTimeMillis()));
		mapper.addDocument(doc);
		
	}
	@Override
	public void updateDocument(Document doc) {
		mapper.updateDocument(doc);
		
	}
	@Override
	public void removeDocument(int id) {
		mapper.removeDocument(id);
		
	}
	
}
